﻿using UnityEngine;
using System.Collections;

public class Check : MonoBehaviour {

	// Use this for initialization
	void Start () {

		transform.localScale = new Vector3 (0.06f, 0.1f);
		GetComponent<UISprite> ().fillAmount = 0;

		GetComponent<UISprite>().depth =  transform.parent.parent.GetComponent<UISprite>().depth + 2;
	}
	
	// Update is called once per frame
	void Update () {


		if (GetComponent<UISprite> ().fillAmount < 1)
			GetComponent<UISprite> ().fillAmount += 4 * Time.fixedDeltaTime;
		else
			GetComponent<UISprite> ().fillAmount = 1;
	}

	public void DestroyThis(){
		Destroy (gameObject);
	}
}
